function GetSystemWarn() {

	var myData = [
			['1', "启用", '警告1', '警告','上班时间','设备1','sss@hotmail.com','1502211546', '王五','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2'],
			['2', "启用", '警告1', '警告','上班时间','设备1','sss@hotmail.com','1502211546', '王五','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2'],
			['3', "启用", '警告1', '警告','上班时间','设备1','sss@hotmail.com','1502211546', '王五','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2'],
			['4', "启用", '警告1', '警告','上班时间','设备1','sss@hotmail.com','1502211546', '王五','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2'],
			['5', "启用", '警告1', '警告','上班时间','设备1','sss@hotmail.com','1502211546', '王五','2012-02-22 12:00:12','test1','2012-04-23 14:00:12','test2']
	];


	var store = new Ext.data.ArrayStore({
				fields : [{
							name : 'id'
						}, {
							name : 'status'
						}, {
							name : 'name'
						}, {
							name : 'desc'
						}, {
							name : 'time'
						}, {
							name : 'device'
						}, {
							name : 'email'
						}, {
							name : 'message'
						}, {
							name : 'manager'
						}, {
							name : 'createtime'
						}, {
							name : 'creator'
						}, {
							name : 'modifytime'
						}, {
							name : 'modifier'
						}]
			});
			



	store.loadData(myData);
	var nowpage = new Ext.Toolbar.TextItem('1');
	var countpage = new Ext.Toolbar.TextItem('共1页');
	var now_page = 0;
	var count_page = 0;
	var sm = new Ext.grid.CheckboxSelectionModel();
	var grid = new Ext.grid.GridPanel({
				store : store,
				columns : [sm, {
							id : 'id',
							header : 'id',
							width : 10,
							sortable : true,
							dataIndex : 'id',
							hidden : true
						}, {
							header : '状态',
							width : 100,
							sortable : true,
							dataIndex : 'status'
						}, {
							header : '警告名称',
							width : 100,
							sortable : true,
							dataIndex : 'name'
						}, {
							header : '警告描述',
							width : 150,
							sortable : true,
							dataIndex : 'desc'
						}, {
							header : '时间',
							width : 150,
							sortable : true,
							dataIndex : 'time'
						}, {
							header : '设备',
							width : 100,
							sortable : true,
							dataIndex : 'device'
						}, {
							header : '邮箱',
							width : 100,
							sortable : true,
							dataIndex : 'email'
						}, {
							header : '短信号码',
							width : 100,
							sortable : true,
							dataIndex : 'message'
						}, {
							header : '创建时间',
							width : 150,
							sortable : true,
							dataIndex : 'createtime'
						}, {
							header : '创建者',
							width : 100,
							sortable : true,
							dataIndex : 'creator'
						}, {
							header : '修改时间',
							width : 150,
							sortable : true,
							dataIndex : 'modifytime'
						}, {
							header : '修改者',
							width : 100,
							sortable : true,
							dataIndex : 'modifier'
						}],
				sm : sm,
				tbar : [{
							text : '添加',
							tooltip : '添加',
							iconCls : 'add',
							handler : function() {
								SetSystemWarn();
							}
						}, '-', {
							text : '编辑',
							tooltip : '编辑',
							iconCls : 'modify',
							ref : '../modifyBtn',
							id:'modifyBtn',
							name:'modifyBtn',
							handler : function() {
								SetSystemWarn();
							}
						}, '-', {
							text : '删除',
							tooltip : '删除',
							iconCls : 'delete',
							ref : '../removeBtn',
							disabled : true,
							handler : function() {
								var s = grid.getSelectionModel().getSelections();
								for (var i = 0; r = s[i]; i++) {
									store.remove(r);
								}
							}
						}, '-', {
							text : '查找',
							tooltip : '查找',
							iconCls : 'search',
							handler : function() {							
							}
						}, '-', {
							text : '刷新',
							tooltip : '刷新',
							iconCls : 'refresh',
							handler : function() {							
								store.loadData(myData);
							}
						}],
				bbar : [{
					tooltip : '首页',
					handler : function() {
						reflashgriad(0);
					},
					iconCls : 'frist'
				}, {

					tooltip : '上一页',
					handler : function() {
						reflashgriad(now_page - 1);
					},
					iconCls : 'perv'
				}, nowpage, {

					tooltip : '下一页',
					handler : function() {
						reflashgriad(now_page + 1);
					},
					iconCls : 'next'
				}, {

					tooltip : '最后一页',
					handler : function() {
						reflashgriad(Math.ceil(count_page / 20) - 1);
					},
					iconCls : 'last'
				}, {
					xtype : "tbfill"
				}, countpage],
				stripeRows : true,
				autoExpandColumn : 'id',
				stateful : true,
				stateId : 'syswarngrid'
			});
	grid.getSelectionModel().on('selectionchange', function(sm) {
				grid.removeBtn.setDisabled(sm.getCount() < 1);
			});


	
	
	return grid;
}	

function SetSystemWarn(setReturn){

	var states = [
		['1', '全部时间'],
		['2', '上班时间'],
		['3', '下班时间']
		];
	var states1 = [
		['1', '设备1'],
		['2', '设备2']
		];

	var set_center = {
		xtype: 'fieldset',
		margins:'5 5 5 5',
		layout : 'form',
		region:'center',
		bodyStyle : 'padding:10px;',
		items: [
						{
									xtype: 'checkbox',
									name: 'status',
									id  : 'status',
									fieldLabel: '是否启用',
									anchor: '100%'
						},{
								xtype : 'textfield',
								fieldLabel : '名称',
								id : 'name',
								name : 'name',
								anchor : '100%'
						},{
								xtype : 'textarea',
								fieldLabel : '描述',
								id : 'desc',
								name : 'desc',
								anchor : '100%'
						},{
								fieldLabel: '时段',
								xtype : 'combo',
								name : 'time',
								frame : true,
								id : 'time',
								store : new Ext.data.ArrayStore({
										fields : ['abbr', 'state'],
										data : states
									}),
								valueField : 'abbr',
								displayField : 'state',
								typeAhead : true,
								mode : 'local',
								triggerAction : 'all',
								value : '1',
								editable : false,
								anchor: '100%'
						},new Ext.form.CompositeField({ 
							    fieldLabel: '选择设备', 
							    items: [ 
							    		
							        new Ext.form.TextField({ 
										    name: 'my_field',
										    value:'',
										    flex: 1 
										  }),{ 
													xtype:"button", 
													text:"...", 
													handler:function() 
													{ 
															GetLinkDevice();
													}
											}
							         
							    ] 
						}),{
		            xtype:'fieldset',
		            checkboxToggle:true,
		            title: '系统运行预警',
		            id:'warn',
		            autoHeight:true,
		            collapsed: false,
		            items :[
		            	new Ext.form.CompositeField({ 
										    fieldLabel: 'CPU', 
										    items: [ 
										    		
										    		{ 
										            xtype: 'checkbox',
																name: 'ccpu',
																id  : 'ccpu'
										        },{
															xtype: 'label',
															style:'padding-top: 5px; ', 
															text:'连续'
														},
										        new Ext.form.TextField({ 
													    name: 'my_field', 
													    flex: 1 
													  }),{
															xtype: 'label',
															style:'padding-top: 5px; ', 
															text:'次,高于'
														},
										        new Ext.form.TextField({ 
													    name: 'my_field', 
													    flex: 1 
													  }),{
															xtype: 'label',
															style:'padding-top: 5px; ', 
															text:'%则报警'
														} 
										         
										    ] 
									}),new Ext.form.CompositeField({ 
										    fieldLabel: '内存', 
										    items: [ 
										    		
										    		{ 
										            xtype: 'checkbox',
																name: 'cmem',
																id  : 'cmem'
										        },{
															xtype: 'label',
															style:'padding-top: 5px; ', 
															text:'连续'
														},
										        new Ext.form.TextField({ 
													    name: 'my_field', 
													    flex: 1 
													  }),{
															xtype: 'label',
															style:'padding-top: 5px; ', 
															text:'次,高于'
														},
										        new Ext.form.TextField({ 
													    name: 'my_field', 
													    flex: 1 
													  }),{
															xtype: 'label',
															style:'padding-top: 5px; ', 
															text:'%则报警'
														} 
										         
										    ] 
									}),new Ext.form.CompositeField({ 
										    fieldLabel: '存储空间', 
										    items: [ 
										    		
										    		{ 
										            xtype: 'checkbox',
																name: 'cdisk',
																id  : 'cdisk'
										        },{
															xtype: 'label',
															style:'padding-top: 5px; ', 
															text:'低于'
														},
										        new Ext.form.TextField({ 
													    name: 'my_field', 
													    flex: 1 
													  }),{
															xtype: 'label',
															style:'padding-top: 5px; ', 
															text:'%则报警'
														} 
										         
										    ] 
									})
		            ]
		        },new Ext.form.CompositeField({ 
							    fieldLabel: '报警短信', 
							    items: [ 
							    		{ 
							            xtype: 'checkbox',
													name: 'cmessage',
													id  : 'cmessage'
							        },
							        new Ext.form.TextField({ 
										    name: 'my_field', 
										    flex: 1 
										  }) 
							         
							    ] 
						}),new Ext.form.CompositeField({ 
							    fieldLabel: '报警邮箱', 
							    items: [ 
							    		{ 
							            xtype: 'checkbox',
													name: 'cemail',
													id  : 'cemail'
							        },
							        new Ext.form.TextField({ 
										    name: 'my_field', 
										    flex: 1 
										  }) 
							         
							    ] 
						})
	
		]
	};

	var setWindows = new Ext.Window({
				layout : 'border',
				width : 600,
				height : 500,
				title : "添加系统预警",
				modal : true,
				resizable : true,
				maximizable : true,
				iconCls : 'tip',
				items : [set_center],
				plain : true
				
			});
	setWindows.addButton({
				text : "确定",
				handler : function() {
					setWindows.close();
				}
			});
	setWindows.addButton({
				text : '取 消',
				handler : function() {
					setWindows.close();
				}
			});
	setWindows.show();
}